Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

319
Visualizações
How to perform a "NOT IN" query in mongodb without using $nin?

I need an alternative to $nin in mongodb. As we know, we can achieve the "IN" query operation by performing "OR" query as well.

In the same way, how can I achieve "NOT IN" functionality in mongodb without using $nin ? What are the alternatives to using $nin in mongodb to acheive exactly same results ?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Well, interesting, But I think It can be achieved by $not

say you have $nin for A,B and C where A,B, C are values which you want to ignore

so instead of calling $nin : [ABC]

what if we call $not : {$or : [A,B,C]}

Update :

Since $not is not working with $or. Maybe you can try $nor which I hope is basically same concept.

over 4 years ago · Santiago Trujillo Relatório

0

I found that there is a operator $nor which exactly does this function. It works as the negation of $or.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda